package com.kingyea.app.market.client;

import com.kingyea.app.market.appauthorization.bean.AppAuthorization;
import com.kingyea.app.market.appauthorization.bean.AppAuthorizationPo;
import com.kingyea.app.market.market.bean.Market;
import com.kingyea.app.market.utils.page.PageInfo;
import com.kingyea.mobilepolice.system.Result;
import com.kingyea.mobilepolice.system.aspect.NotResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "app-market-dataBase")
public interface MarketServiceClient {

    /**
     * 创建
     *
     * @param market
     * @return
     */
    @NotResult
    @RequestMapping(value = "/market/addMarket", method = RequestMethod.POST)
    Object create(@RequestBody Map<String, Object> market) throws Exception;

    @NotResult
    @RequestMapping(value = "/market/condition", method = RequestMethod.POST)
    Result<PageInfo<Market>> conditionQuery(@RequestBody Map<String, Object> market) throws Exception;

    @RequestMapping(value = "/market/queryList", method = RequestMethod.POST)
    @NotResult
    Result<List<Market>> queryList(@RequestBody Map<String, Object> map) throws Exception;

    @NotResult
    @PostMapping(value = "/appAuthorization/notPageSerach")
    Object notPageSerach(@RequestBody AppAuthorization appAuthorization) throws Exception;

    @NotResult
    @RequestMapping(value = "/appAuthorization/getbyUser", method = RequestMethod.POST)
    Object getbyUser(@RequestBody AppAuthorizationPo appAuthorization) throws Exception;

    @RequestMapping(value = "/market/getMarketObj/{marketCode}", method = RequestMethod.GET)
    Market getByCode(@PathVariable(value = "marketCode") String appCode);
}
